package com.ekang.admin.dao;

import com.ekang.admin.model.Goods;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

/**
 * Created by zcz on 2017/10/26.
 */
@Mapper
@CacheNamespace(size=100)
public interface GoodsMapper {

    @Select("select * from tgoods where goodsId=#{id}")
    Goods getGoodsById(@Param("id") Integer id);

    @Select("select * from tgoods where goodsNO=#{goodsNO}")
    Goods getGoodsByGoodsNO(@Param("phone") String goodsNO);

    @Select("select * from tgoods where status='1' order by goodsType")
    List<Goods> getAllGoods();

    @Update("update tgoods set status=#{state} where goodstype=#{type}")
    int updateGoodsState(@Param("type") String type, @Param("state") String state);


    @Select("select * from tgoods where 1=1")
    List<Goods> getGoodsList(@Param("para") Map<String, String> para);


}
